#ifndef ___INTERFACE_H
#define ___INTERFACE_H

/******堆排序中用到的宏*******/
/* 堆排序中求parent 的宏 */
#define PARENT(base, index, size)  \
({ \
		int i = (index - base) / size; \
		void *ret = (i - 1) / 2 * size + base; \
		ret; \
})
#define LEFT(base, index, size) ({ \
		int i = (index - base) / size; \
		void *ret = (2 * i + 1) * size + base; \
		ret; \
})
#define RIGHT(base, index, size) ({\
		int i = (index - base) / size; \
		void *ret = (2 * i + 2) * size + base; \
		ret; \
})
/******************************/

#endif
